home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form frm10_1_5
- Caption = "10-1-5"
- ClientHeight = 1815
- ClientLeft = 1095
- ClientTop = 1485
- ClientWidth = 2280
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- LinkTopic = "Form1"
- PaletteMode = 1 'UseZOrder
- ScaleHeight = 1815
- ScaleWidth = 2280
- Begin VB.CommandButton cmdDraw
- Caption = "Draw"
- Height = 495
- Left = 480
- TabIndex = 1
- Top = 1200
- Width = 1335
- End
- Begin VB.PictureBox picOutput
- Height = 975
- Left = 120
- ScaleHeight = 915
- ScaleWidth = 1995
- TabIndex = 0
- Top = 120
- Width = 2055
- End
- Attribute VB_Name = "frm10_1_5"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Private Sub cmdDraw_Click()
- 'Center and underline a phrase
- Dim xCenter As Single, yCenter As Single, phrase As String
- Dim w As Single, h As Single, leftEdge As Single, rightedge As Single
- Dim ul1Pos As Single, ul2Pos As Single
- picOutput.Scale (0, 4)-(6, 0)
- picOutput.Cls
- xCenter = 3
- yCenter = 2
- phrase = "Th-that's all Folks!"
- w = picOutput.TextWidth(phrase)
- h = picOutput.TextHeight(" ")
- picOutput.CurrentX = xCenter - w / 2
- picOutput.CurrentY = yCenter - h / 2
- picOutput.Print phrase
- leftEdge = xCenter - w / 2
- rightedge = xCenter + w / 2
- ul1Pos = yCenter + h / 2
- ul2Pos = ul1Pos + h / 6
- picOutput.Line (leftEdge, ul1Pos)-(rightedge, ul1Pos)
- picOutput.Line (leftEdge, ul2Pos)-(rightedge, ul2Pos)
- End Sub
-